<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>数组提取和任意位置添加删除</title>
	</head>
	<body>
		<script type="text/javascript">
		//concat
/* 		var arr = ["天明","少羽","盖聂","卫庄"];
		var arr2 = ["白凤","红莲"];
		var arr3 = ["韩非","子房"];	
		var newArr = arr.concat(arr2,arr3);
		console.log(newArr); */


		//将数组转化为字符串
		/* var arr = ["儒家","墨家","道家","农家"];
		console.log(arr.toString());
		console.log(arr.join("-")); */


		//将伪数组转化为数组
	/* 	var arr =function(){
			console.log(arguments);
			var newArr = Array.prototype.slice.call(arguments);
			console.log(newArr);
		};

		arr(1,2,3,4,5,6);
	*/


		//slice
		var arr = ["儒家", "墨家", "道家", "农家"];
		/*var newArr = arr.slice(1,4);
		console.log(newArr);
		console.log(arr); */
		//splice
		var newArr2 = arr.splice(2,2);
		console.log(newArr2);
		console.log(arr);
/* 
		var newArr3 = arr.splice(1,0,"鬼谷");
		console.log(newArr3);
		console.log(arr);
 */



		

		</script>
	</body>
</html>